package service

import (
	"encoding/json"
	"io"
	"io/ioutil"
)

func bodytoMap(body io.ReadCloser) (m map[string]interface{}, e error) {
	b, _ := ioutil.ReadAll(body)
	var f interface{}
	e = json.Unmarshal(b, &f)
	if e != nil {
		return
	}
	m = f.(map[string]interface{})
	return
}
